/**
 * 
 */
package com.fashop.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fashop.bean.local.ListadoLocalOut;
import com.fashop.bean.local.LocalIn;
import com.fashop.bean.local.LocalOut;
import com.fashop.service.LocalService;

/**
 * @author Alan Dávila
 * e-mail ustargab@gmail.com
 * date 14/01/2014 23:54:09
 */
@Controller
@RequestMapping("/local")
public class LocalController {

	@Resource(name = "localServiceImpl")
	private LocalService localServiceImpl;
	
	@RequestMapping(value = "/get", method = RequestMethod.POST)
	@ResponseBody
	public LocalOut getLocal(@RequestBody final LocalIn local) {
		LocalOut respuesta = localServiceImpl.get(local);
		return respuesta;
	}
	
	@RequestMapping(value = "/listado/{idempresa}", method = RequestMethod.GET)
	@ResponseBody
	public ListadoLocalOut listado(@RequestParam Long idempresa) {
		ListadoLocalOut respuesta = localServiceImpl.listado(idempresa);
		return respuesta;
	}
	
}
